1. Field of the Invention
The present invention relates to generating graphics. Specifically, the present invention relates to a method and system for texturing.
2. Description of Related Art
In computer graphics, existing texture-rendering techniques map a pixel on a screen (typically using screen coordinates (x, y)) to a polygon, such as a triangle, on a surface in a viewing plane (typically using geometric or surface coordinates (s, t)). The polygon is rasterized into a plurality of smaller pieces called fragments. Each polygon may have information, such as color and/or a normal vector, associated with each vertex of the polygon. To assign a texture (i.e., a color pattern or image, either digitized or synthesized) to a fragment, the fragment is mapped onto a texture map (typically using texture coordinates (u, v)). Texture maps are stored in a texture memory. A texture map represents a type of image, such as stripes, check.erboards, or complex patterns that characterize natural materials. A texture map comprises a plurality of texels. A texel is the smallest graphical element in a 2-D texture map used to render a 3-D object.
Each texture map has a plurality of associated MIP (multum in parvo) maps, which are abbreviated versions of a full texture map. One of the MIP maps may be selected to provide a suitable resolution for the fragment of the polygon in the viewing plane. The texture from the selected MIP map is applied onto the fragment. The applied texture may be blended with a color already associated with the fragment or polygon.
Existing texture-rendering techniques are able to model a simple opaque surface, but are unable to accurately render a semi-opaque surface, where the upper layers of the surface are partially transparent, and reveal sub-surface details. A semi-opaque surface is not transparent in that an object behind the surface will not show through it. The transparency of a semi-opaque surface applies to the upper layers of the surface, as the upper layers allow details from the lower surface layers to appear.
Existing texture-rendering techniques cannot account for surface thickness without either explicitly modeling all of the surface layers individually or by mathematically calculating the contents of the entire three-dimensional volume that encloses the surface. Both of these techniques require additional hardware and/or software and may require a longer processing time.
Another problem with conventional texturing systems is the need to make multiple passes in order to apply multiple textures to a fragment, which is called ‘multi-texturing.’ Conventional texturing systems can only access and read one texture image (a MIP map set) at a time. For multi-texturing, conventional texturing systems must make multiple passes, i.e., read a first texture image, then a second texture image, then a third texture image, etc. After all the texture images have been read, conventional systems typically separate the texel data into individual components and combine the color components from each texture image to produce a blended color to apply to a fragment.
The multiple passes and other processes of conventional systems require a long processing time, which is undesirable to the user.